from pydub import AudioSegment
#转化函数方法
def trans_mp3_to_wav(filepath,hz):
    song = AudioSegment.from_mp3(filepath)
    print(song)
    song.export("Python研究者."+str(hz), format=str(hz))

### 参数1：音频路径， 参数2：转换后的格式
# trans_mp3_to_wav("test.mp3","wav")
# trans_mp3_to_wav("test.mp3","ogg")
trans_mp3_to_wav("test.wav", "flac")

# trans_mp3_to_wav("./test.mp3", "wav")
# trans_mp3_to_wav("./test.mp3", "ogg")
# trans_mp3_to_wav("./test.mp3", "flac")

# trans_mp3_to_wav(r'D:\项目集\python项目\my_ch_speech_recognition-master\MY_INI\test.mp3','zjy')
